<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Index extends BaseController
{
    public function __construct()
    {
        parent::__construct();
        $this->load->model("index_model","index");
        $this->load->model("Headhunt_model","headhunt");
    }
    public function index(){
        $_SESSION['menu'] = "home";
    	$bannerList = $this->index->getBannerList();
        $bannerList_Left = $bannerList_Right = [];
        if(!empty($bannerList))
        {
            foreach ($bannerList as $key => $value) {
                if($key%2 == 0)
                {
                    $bannerList_Left[] = $value;
                }else{
                    $bannerList_Right[] = $value;
                }
            }
        }
    	$data = array(
            'bannerList_Left'=>$bannerList_Left,
    		'bannerList_Right'=>$bannerList_Right,
    		);
        $this->load->view('Index/index',$data);
    }
}